package com.ayf.payment.game.api.controller.ayb;

import com.ayf.payment.game.api.dto.MerchantDTO;
import com.ayf.payment.game.api.service.ayb.AybUserTransferBindService;
import com.ayf.payment.game.api.type.CommonConstants;
import com.ayf.payment.game.api.utils.*;
import com.ayf.payment.game.api.vo.AybChannelConfigVO;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RequestMapping("/v/ayb/usertransferbind")
@RestController
public class AybUserTransferBindController {

    @Resource
    private AybUserTransferBindService aybUserTransferBindService;


    /**
     * 获取绑定爱游宝的二维码
     * @author lch
     * @date 2021/12/9
     */
    @PostMapping("/getBindQrCode")
    public CommonResult<?> getBindQrCode(MerchantDTO merchantDTO) {
		String bindQrCode = this.aybUserTransferBindService.getBindQrCode(merchantDTO);
		return new CommonResult(CommonConstants.RETURN_SUCCESS, "获取成功", bindQrCode);
    }

    /**
     * 获取解绑爱游宝的二维码
     * @author lch
     * @date 2021/12/9
     */
    @PostMapping("/getUnBindQrCode")
    public CommonResult<?> getUnBindQrCode(MerchantDTO merchantDTO) {
        String unBindQrCode = this.aybUserTransferBindService.getUnBindQrCode(merchantDTO);
        return new CommonResult(CommonConstants.RETURN_SUCCESS, "获取成功", unBindQrCode);
    }

    /**
     * 查询绑定结果
     * @author lch
     * @date 2021/12/9
     */
    @PostMapping("/getBindResult")
    public CommonResult<?> getBindResult(MerchantDTO merchantDTO) {
        AybChannelConfigVO vo = this.aybUserTransferBindService.getBindResult(merchantDTO);
        return new CommonResult(CommonConstants.RETURN_SUCCESS, "获取成功", vo);
    }

    /**
     * 查询解绑结果
     * @author lch
     * @date 2021/12/9
     */
    @PostMapping("/getUnBindResult")
    public CommonResult<?> getUnBindResult(MerchantDTO merchantDTO) {
        Boolean flag = this.aybUserTransferBindService.getUnBindResult(merchantDTO);
        return new CommonResult(CommonConstants.RETURN_SUCCESS, "操作成功", flag);
    }


}
